Repository navigation
fix(angular): migration schematic no longer aborts on file subpath imports - #12033
Conversation
…ports TypeScript probes `directoryExists` with paths that are files during module resolution; `Tree.getDir()` throws on those. Report them as non-directories. Fixes TanStack#12032 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
View your CI Pipeline Execution ↗ for commit 1e3270d
☁️ Nx Cloud last updated this comment at |
benjavicente
left a comment
There was a problem hiding this comment.
LGTM, thanks for the PR!
🎯 Changes
Fixes #12032.
migrate-from-experimentalaborts before migrating anything when a project source imports a package subpath that names a file, for exampleimport { sha3_256 } from '@noble/hashes/sha3.js':TypeScript's module resolution calls the compiler host's
directoryExistswith candidate paths, and some of them are files. The host inconfiguredSources()passed every path totree.getDir(), which throwsPathIsFileExceptionfor a file.directoryExistsnow returnsfalsewhen the path is a file (tree.exists()is true only for files).The new regression test in
migrate-from-experimental.test.tsbuilds a workspace whose source imports a file subpath of a package with anexportsmap. It fails without the fix, with the error above, and passes with it. Repro: https://github.com/imaksp/tanstack-angular-query-migrate-schematic-repro✅ Checklist
pnpm run test:pr, or these tests do not apply to this pull request.test:pr. Inpackages/angular-queryI ran the schematic suite (vitest.schematics.config.ts, 71/71),test:eslintandtest:types:tscurrent.🚀 Release Impact
🤖 Generated with Claude Code